package com.zkh.myutils.io.excel.worksheet.style;

import java.util.Objects;

/**
 * 边框样式
 * @author zkh
 */
public class BorderStyle {
	//加粗
	private boolean bold;
	//颜色
	private String color;
	
	/**
	 * 构造方法，默认黑色不加粗边框
	 */
	public BorderStyle() {
		this.color = "#000000";
	}
	
	/**
	 * 构造方法，黑色边框
	 * @param bold 是否加粗，默认false
	 */
	public BorderStyle(boolean bold) {
		this.bold = bold;
	}
	
	/**
	 * 构造方法，不加粗边框
	 * @param color 边框颜色
	 */
	public BorderStyle(String color) {
		this.color = color;
	}
	
	/**
	 * 构造方法
	 * @param bold 是否加粗，默认false
	 * @param color 边框颜色
	 */
	public BorderStyle(boolean bold, String color) {
		this.bold = bold;
		this.color = color;
	}
	
	/**
	 * 是否加粗
	 * @return
	 */
	public boolean isBold() {
		return bold;
	}
	
	/**
	 * 获取颜色
	 * @return
	 */
	public String getColor() {
		return color;
	}

	@Override
	public int hashCode() {
		return Objects.hash(bold, color);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BorderStyle other = (BorderStyle) obj;
		return bold == other.bold && Objects.equals(color, other.color);
	}

	@Override
	public String toString() {
		return "BorderStyle [bold=" + bold + ", color=" + color + "]";
	}
}
